home *** CD-ROM | disk | FTP | other *** search
- { Here it is, the source of CHECKER!! WOW?!?!?!?!?....
- For some wierd reason certain persons wanted to see this....
- Well, they must be feeling pretty happy know:]
- But O.K. I rewrote the source a bit to make it a little more 'readable'
- and understandable.... I don't have the time nor want to include to many
- comments. But it ain't to dificult to understand so don't dispare.....
- -SHARP-
- }
-
- {$M 4000,0,65000 }
- uses crt,ucihsc,vga;
-
- type
- vlak = array[1..675] of byte;
-
- var i,j,c : integer;
- cols : vlak;
- pal : array[0..256,1..3] of byte;
- Text : string[255];
- Textpos : integer;
- TextX : integer;
- TextAddr : integer;
- subX : integer;
-
- count : integer;
- placecnt : integer;
-
- const
- { standard checker }
- check1 : vlak =
- ( 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63,
- 0,0,42,0,0,42,0,0,42,0,0,42,0,0,42,0,0,42,0,0,42,0,0,42,
- 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63,
- 0,0,45,0,0,45,0,0,45,0,0,45,0,0,45,0,0,45,0,0,45,0,0,45,
- 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63,
- 0,0,48,0,0,48,0,0,48,0,0,48,0,0,48,0,0,48,0,0,48,0,0,48,
- 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63,
- 0,0,51,0,0,51,0,0,51,0,0,51,0,0,51,0,0,51,0,0,51,0,0,51,
- 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63,
- 0,0,54,0,0,54,0,0,54,0,0,54,0,0,54,0,0,54,0,0,54,0,0,54,
- 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63,
- 0,0,57,0,0,57,0,0,57,0,0,57,0,0,57,0,0,57,0,0,57,0,0,57,
- 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63,
- 0,0,60,0,0,60,0,0,60,0,0,60,0,0,60,0,0,60,0,0,60,0,0,60,
- 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63,
- 0,0,63,0,0,63,0,0,63,0,0,63,0,0,63,0,0,63,0,0,63,0,0,63,
-
- 0,0,45,0,0,45,0,0,45,0,0,45,0,0,45,0,0,45,0,0,45,63,63,63,
- 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63,
- 0,0,48,0,0,48,0,0,48,0,0,48,0,0,48,0,0,48,0,0,48,63,63,63,
- 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63,
- 0,0,51,0,0,51,0,0,51,0,0,51,0,0,51,0,0,51,0,0,51,63,63,63,
- 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63,
- 0,0,54,0,0,54,0,0,54,0,0,54,0,0,54,0,0,54,0,0,54,63,63,63,
- 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63,
- 0,0,57,0,0,57,0,0,57,0,0,57,0,0,57,0,0,57,0,0,57,63,63,63,
- 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63,
- 0,0,60,0,0,60,0,0,60,0,0,60,0,0,60,0,0,60,0,0,60,63,63,63,
- 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63,
- 0,0,63,0,0,63,0,0,63,0,0,63,0,0,63,0,0,63,0,0,63,63,63,63,
- 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63, 63,63,63);
-
- { UN checker : }
- check2 : vlak = (
- 34,34,34, 34,34,34, 34,34,34, 34,34,34, 34,34,34, 0,0,40, 0,0,40, 0,0,40, 0,0,40, 34,34,34, 34,34,34, 34,34,34, 34,34,34,
- 34,34,34, 34,34,34,
- 36,36,36, 36,36,36, 36,36,36, 36,36,36, 0,0,42, 0,0,42, 0,0,42, 0,0,42, 0,0,42, 0,0,42, 36,36,36, 36,36,36, 36,36,36,
- 36,36,36, 36,36,36,
- 38,38,38, 38,38,38, 38,38,38, 0,0,44, 0,0,44, 40,0,0, 40,0,0, 38,38,38, 38,38,38, 0,0,44, 0,0,44, 38,38,38, 40,0,0,
- 40,0,0, 38,38,38,
- 40,40,40, 40,40,40, 40,40,40, 0,0,46, 0,0,46, 42,0,0, 40,40,40, 40,40,40, 40,40,40, 0,0,46, 0,0,46, 40,40,40, 40,40,40,
- 42,0,0, 42,0,0,
- 42,42,42, 42,42,42, 0,0,48, 0,0,48, 44,0,0, 44,0,0, 42,42,42, 42,42,42, 42,42,42, 0,0,48, 0,0,48, 42,42,42, 42,42,42,
- 44,0,0, 44,0,0,
- 44,44,44, 44,44,44, 0,0,50, 0,0,50, 46,0,0, 46,0,0, 44,44,44, 44,44,44, 44,44,44, 44,44,44, 0,0,50, 0,0,50, 44,44,44,
- 46,0,0, 46,0,0,
- 46,46,46, 46,46,46, 0,0,52, 0,0,52, 48,0,0, 48,0,0, 46,46,46, 46,46,46, 46,46,46, 46,46,46, 0,0,52, 0,0,52, 46,46,46,
- 48,0,0, 48,0,0,
- 48,48,48, 0,0,54, 0,0,54, 48,48,48, 50,0,0, 50,0,0, 48,48,48, 48,48,48, 48,48,48, 48,48,48, 0,0,54, 0,0,54, 50,0,0,
- 50,0,0, 48,48,48,
- 50,50,50, 0,0,56, 0,0,56, 50,50,50, 52,0,0, 52,0,0, 50,50,50, 50,50,50, 50,50,50, 50,50,50, 0,0,56, 0,0,56, 52,0,0,
- 52,0,0, 50,50,50,
- 52,52,52, 0,0,58, 0,0,58, 52,52,52, 52,52,52, 54,0,0, 54,0,0, 52,52,52, 52,52,52, 52,52,52, 0,0,58, 0,0,58, 54,0,0,
- 54,0,0, 52,52,52,
- 54,54,54, 0,0,60, 0,0,60, 54,54,54, 54,54,54, 56,0,0, 56,0,0, 54,54,54, 54,54,54, 54,54,54, 0,0,60, 0,0,60, 56,0,0,
- 54,54,54, 54,54,54,
- 56,56,56, 56,56,56, 0,0,62, 0,0,62, 58,0,0, 58,0,0, 58,0,0, 56,56,56, 56,56,56, 0,0,62, 0,0,62, 58,0,0, 58,0,0,
- 56,56,56, 56,56,56,
- 58,58,58, 58,58,58, 58,58,58, 58,58,58, 60,0,0, 60,0,0, 60,0,0, 60,0,0, 60,0,0, 60,0,0, 60,0,0, 60,0,0, 58,58,58,
- 58,58,58, 58,58,58,
- 60,60,60, 60,60,60, 60,60,60, 60,60,60, 62,0,0, 62,0,0, 60,60,60, 62,0,0, 62,0,0, 62,0,0, 62,0,0, 60,60,60, 60,60,60,
- 60,60,60, 60,60,60,
- 62,62,62, 62,62,62, 62,62,62, 62,62,62, 62,62,62, 62,62,62, 62,62,62, 62,62,62, 62,62,62, 62,62,62, 62,62,62, 62,62,62,
- 62,62,62, 62,62,62, 62,62,62);
-
- { Font..... }
- {$L BIG.OBJ}
- {$F+}
- procedure BigFont; external;
- {$F-}
-
- { Change all palette intries.....}
- procedure allpal;
- label palcycl;
- begin
- port[$3c8] :=0;
- asm
- cli
- push ds
- mov dx,3c9h
- mov cx,226*3
- mov ax,seg(pal)
- mov ds,ax
- mov si,offset pal
- palcycl:
- lodsb
- out dx,al
- loop palcycl
- pop ds
- sti
- end;
- end;
-
- procedure Einde;
- var vangaf : char;
- begin
- if keypressed then vangaf:=readkey;
- asm
- mov ax,3h
- int 10h
- end;
- writeln(' UNICORN UTM 1994 ');
- writeln;
- writeln(' Checkerboard, made by SHARP, hope ya liked it..... ');
- writeln;
- writeln(' UNICORN UTM can be reached in theze wayz:');
- writeln(' Writing to:');
- writeln(' UNICORN UTM ');
- writeln(' Bastiaan Olij ');
- writeln(' Pr. Hendrikstraat 30');
- writeln(' 2161 SE LISSE');
- writeln(' NEDERLAND');
- writeln;
- writeln(' Or contact via FIDO: Nr 2:500/143.2280.');
- writeln;
- writeln(' Hace fun!!!...grtz to all....l8r....');
- Stopplaying;
- RemoveHSCfile;
- UndoHSC;
- halt(0);
- end;
-
- { Change the checker... }
- procedure cyclecols(x,y : integer);
- var buff : vlak;
- b1,b2 : integer;
- nv1,nv2 : integer;
- i1,j1 : integer;
- begin
- for j := 0 to 14 do begin
- nv1:=((15+j+x) mod 15) * 3;
- for i:= 0 to 14 do begin
- nv2:=45*((15+i+y) mod 15);
- i1:=45*i;
- j1:=j*3;
- buff[i1 + j1 + 1]:=cols[nv2+nv1+1];
- buff[i1 + j1 + 2]:=cols[nv2+nv1+2];
- buff[i1 + j1 + 3]:=cols[nv2+nv1+3];
- end;
- end;
- cols:=buff;
- end;
-
- { Draw the checkerboard once so you can keep using it }
- procedure makecheck;
- var x,y,x3,z3 : integer;
- xc,yc : integer;
- col : byte;
- begin
- for y:=110 to 210 do begin
- z3:=10000 div (y-50);
- yc:=z3 mod 15;
- for x:=0 to 319 do begin
- x3:=z3 * (x-160);
- xc:=((x3 div 200) + 32000) mod 15;
- col:=(xc+yc*15)+1;
- PutPixX(X,Y,Col);
- end;
- end;
- end;
-
- { Update the hardware scoller (yes it is slow and unoptimized but it works
- fine!!!! }
- procedure cycletext;
- var charnr : integer;
- shifted : integer;
- tshift : integer;
- begin
- CASE text[TextPos] of
- 'A'..'Z' : charnr:=ord(text[TextPos])-64;
- 'a'..'z' : charnr:=ord(text[TextPos])-96;
- ' ' : charnr:=27;
- '?' : charnr:=28;
- '-' : charnr:=29;
- '.' : charnr:=30;
- '''' : charnr:=31;
- '(' : charnr:=32;
- ')' : charnr:=33;
- '!',':' : charnr:=34;
- ELSE charnr:=27;
- end;
- charnr:=charnr-1;
- shifted:=subX shl 1;
- tshift:=TextX shl 2;
- for i:=0 to 24 do begin
- PutPixX(324+shifted+TextAddr shl 2,220+i,mem[seg(Bigfont):ofs(Bigfont)+(charnr*500)+(25*(Tshift+shifted))+i]+226);
- PutPixX(325+shifted+TextAddr shl 2,220+i,mem[seg(Bigfont):ofs(Bigfont)+(charnr*500)+(25*(tshift+1+shifted))+i]+226);
- end;
- ASM cli END;
- Pan(((TextAddr+1)*4)+subX,220);
- ASM sti END;
- for i:=0 to 24 do begin
- PutPixX(shifted+TextAddr shl 2,220+i,mem[seg(Bigfont):ofs(Bigfont)+(500*charnr)+(25*(tshift+shifted))+i]+226);
- PutPixX(shifted+TextAddr shl 2 + 1,220+i,mem[seg(Bigfont):ofs(Bigfont)+(500*charnr)+(25*(tshift+1+shifted))+i]+226);
- end;
- if subX=1 then begin
- inc(TextX);
- if TextX=5 then begin
- TextX:=0;
- inc(TextPos);
- end;
- inc(TextAddr);
- if TextAddr=80 then begin
- TextAddr:=-1;
- end;
- end;
- inc(subX);
- if subX=2 then subX:=0;
- end;
-
- label mainloop;
- begin
- InitMode(V320X240X,640);
- SetSplit(50);
- Pan(0,220);
- subX:=0;
-
- for i:=0 to 255 do begin
- setcolor(i,0,0,0);
- pal[i,1]:=0;
- pal[i,2]:=0;
- pal[i,3]:=0;
- end;
- pal[227,1]:=0;
- pal[227,2]:=0;
- pal[227,3]:=55;
- setcolor(227,0,0,55);
-
- makecheck;
-
- PrepareHSC;
- LoadHSCfile('CHECKER.HSC');
- StartPlaying;
-
- Mainloop:
-
- { first loop, normal scroller... }
-
- count:=0;
- fillchar(text,sizeof(text),' ');
- { Not the best way to store the text but it works... }
- text:='Yo SHARP here.. Just a little scroller I made. Lets see what we can do to fill up the emptyness...';
- Textpos:=1;
- TextX:=0;
- TextAddr:=0;
- repeat
- cycletext;
-
- if keypressed then einde;
- inc(count);
- until count=1150;
-
- { second loop, added checkerboard... }
-
- count:=0;
- cols:=check1;
- fillchar(text,sizeof(text),' ');
- text:='Hmmm.. A simple checkerboard... Maybe it can do a little more?!?...';
- Textpos:=1;
- TextX:=0;
- TextAddr:=0;
- repeat
- cycletext;
- allpal;
-
- for i:=1 to 15 do begin
- for j:=0 to 14 do begin
- pal[i+j*15,1]:=cols[(j) * 45+ (i-1) * 3 + 1];
- pal[i+j*15,2]:=cols[(j) * 45+ (i-1) * 3 + 2];
- pal[i+j*15,3]:=cols[(j) * 45+ (i-1) * 3 + 3];
- end;
- end;
- cyclecols(0,2);
-
- if keypressed then einde;
- inc(count);
- until count=830;
-
- { third loop, bit more movement in checker }
- count:=0;
- placecnt:=0;
- fillchar(text,sizeof(text),' ');
- text:='Ahhh.. That''s better... But why such a stuped checkerd pattern?!?...';
- Textpos:=1;
- TextX:=0;
- TextAddr:=0;
- repeat
- cycletext;
- allpal;
- {for i:=1 to 225 do setcolor(i,pal[i,1],pal[i,2],pal[i,3]);}
-
- for i:=1 to 15 do begin
- for j:=0 to 14 do begin
- pal[i+j*15,1]:=cols[(j) * 45+ (i-1) * 3 + 1];
- pal[i+j*15,2]:=cols[(j) * 45+ (i-1) * 3 + 2];
- pal[i+j*15,3]:=cols[(j) * 45+ (i-1) * 3 + 3];
- end;
- end;
- case placecnt of
- 0..50 : cyclecols(2,0);
- 51..100 : cyclecols(0,-2);
- 101..150 : cyclecols(-2,0);
- 151..200 : cyclecols(0,2);
- else cyclecols(0,0);
- end;
- inc(placecnt);
- if placecnt=201 then placecnt:=0;
-
- if keypressed then einde;
- inc(count);
- until count=850;
-
- { fourth loop, Different pattern.. }
- count:=0;
- cols:=check2;
- placecnt:=0;
- fillchar(text,sizeof(text),' ');
- text:='Hmm.. U....N..... not the most original but...';
- Textpos:=1;
- TextX:=0;
- TextAddr:=0;
- repeat
- cycletext;
- allpal;
- {for i:=1 to 225 do setcolor(i,pal[i,1],pal[i,2],pal[i,3]);}
-
- for i:=1 to 15 do begin
- for j:=0 to 14 do begin
- pal[i+j*15,1]:=cols[(j) * 45+ (i-1) * 3 + 1];
- pal[i+j*15,2]:=cols[(j) * 45+ (i-1) * 3 + 2];
- pal[i+j*15,3]:=cols[(j) * 45+ (i-1) * 3 + 3];
- end;
- end;
- case placecnt of
- 0..50 : cyclecols(2,0);
- 51..100 : cyclecols(0,-2);
- 101..150 : cyclecols(-2,0);
- 151..200 : cyclecols(0,2);
- else cyclecols(0,0);
- end;
- inc(placecnt);
- if placecnt=201 then placecnt:=0;
-
- if keypressed then einde;
- inc(count);
- until count=620;
-
- count:=0;
- fillchar(text,sizeof(text),' ');
- text:='Well... O.K. to business. This little thing was programmed by me -SHARP- the GFX was also done by me... The music';
- text:=text+' came with the hsc player that was made by UCi -Hi Myxtronic - Hi RTF - ....';
- Textpos:=1;
- TextX:=0;
- TextAddr:=0;
- repeat
- cycletext;
- allpal;
- {for i:=1 to 225 do setcolor(i,pal[i,1],pal[i,2],pal[i,3]);}
-
- for i:=1 to 15 do begin
- for j:=0 to 14 do begin
- pal[i+j*15,1]:=cols[(j) * 45+ (i-1) * 3 + 1];
- pal[i+j*15,2]:=cols[(j) * 45+ (i-1) * 3 + 2];
- pal[i+j*15,3]:=cols[(j) * 45+ (i-1) * 3 + 3];
- end;
- end;
- case placecnt of
- 0..50 : cyclecols(2,0);
- 51..100 : cyclecols(0,-2);
- 101..150 : cyclecols(-2,0);
- 151..200 : cyclecols(0,2);
- else cyclecols(0,0);
- end;
- inc(placecnt);
- if placecnt=201 then placecnt:=0;
-
- if keypressed then einde;
- inc(count);
- until count=2050;
-
- count:=0;
- fillchar(text,sizeof(text),' ');
- text:='So.. we are comming to the end of this small intro now so here are the greetz - DSF - DUST - Future';
- text:=text+' Crew - Renaissance - RiToSoft - SMA-POSSE - The United Crew - TKB - Triton -';
- Textpos:=1;
- TextX:=0;
- TextAddr:=0;
- repeat
- cycletext;
- allpal;
- {for i:=1 to 225 do setcolor(i,pal[i,1],pal[i,2],pal[i,3]);}
-
- for i:=1 to 15 do begin
- for j:=0 to 14 do begin
- pal[i+j*15,1]:=cols[(j) * 45+ (i-1) * 3 + 1];
- pal[i+j*15,2]:=cols[(j) * 45+ (i-1) * 3 + 2];
- pal[i+j*15,3]:=cols[(j) * 45+ (i-1) * 3 + 3];
- end;
- end;
- case placecnt of
- 0..50 : cyclecols(2,0);
- 51..100 : cyclecols(0,-2);
- 101..150 : cyclecols(-2,0);
- 151..200 : cyclecols(0,2);
- else cyclecols(0,0);
- end;
- inc(placecnt);
- if placecnt=201 then placecnt:=0;
-
- if keypressed then einde;
- inc(count);
- until count=1940;
-
- count:=0;
- fillchar(text,sizeof(text),' ');
- text:='Well... I didn''t menage to fill up all the space below me. Heck! we need a GFX-artist so contact me!!! See Ya...';
- Textpos:=1;
- TextX:=0;
- TextAddr:=0;
- repeat
- cycletext;
- allpal;
- {for i:=1 to 225 do setcolor(i,pal[i,1],pal[i,2],pal[i,3]);}
-
- for i:=1 to 15 do begin
- for j:=0 to 14 do begin
- pal[i+j*15,1]:=cols[(j) * 45+ (i-1) * 3 + 1];
- pal[i+j*15,2]:=cols[(j) * 45+ (i-1) * 3 + 2];
- pal[i+j*15,3]:=cols[(j) * 45+ (i-1) * 3 + 3];
- end;
- end;
- case placecnt of
- 0..50 : cyclecols(2,0);
- 51..100 : cyclecols(0,-2);
- 101..150 : cyclecols(-2,0);
- 151..200 : cyclecols(0,2);
- else cyclecols(0,0);
- end;
- inc(placecnt);
- if placecnt=201 then placecnt:=0;
-
- if keypressed then einde;
- inc(count);
- until count=1290;
-
-
- for i:=0 to 225 do begin
- pal[i,1]:=0;
- pal[i,2]:=0;
- pal[i,3]:=0;
- end;
-
- for i:=1 to 225 do setcolor(i,pal[i,1],pal[i,2],pal[i,3]);
- goto mainloop;
-
- einde; { the point that i'll never be reached:-) }
- end.
- { Well that was that.... A simple little thingy isn't?? Hardly any
- uptimization but eh who cares, it works!!!! Heck, I made it just
- cause I wanne to see if it would work, so who cares if it's slow????
- Well I don't!!!!
-
- Have Fun, SHARP......}